package c2.cross.business.championrace.handler;

import c2.cross.business.championrace.ChampionRaceModule;
import cate.game.event.championrace.ChampionRaceTimerEvent;
import cate.game.pvp.championrace.timer.ChampionRaceTimerTask;


public class ChampionRaceRankRwdSettingHandler extends AbstractChampionRaceSettingHandler{

    public ChampionRaceRankRwdSettingHandler(ChampionRaceModule parent) {
        super(parent);
    }

    @Override
    public boolean runSettingFunction(ChampionRaceTimerTask.Setting setting) {
        boolean change = parent.canChangeSpec(setting, setting.getEventType().getFlag());
        if (!change) {
            return true;
        }
        parent.settleRankReward();
        parent.changeSpec(setting, setting.getEventType().getFlag());
        return true;
    }

    @Override
    public boolean isMatch(ChampionRaceTimerTask.Setting setting) {
        return setting.getEventType() == ChampionRaceTimerEvent.EventType.RANK_SWITCH;
    }

    @Override
    public void run() {

    }
}
